#ifndef __POS_H__
#define __POS_H__

#include "gd32e23x.h"
#include "reader.h"

#ifdef SEGLCD_V2206    
    #define Valve_ON   gpio_bit_set(GPIOB,GPIO_PIN_1)
    #define Valve_OFF  gpio_bit_reset(GPIOB,GPIO_PIN_1)
#else
    #define Valve_ON   gpio_bit_set(GPIOB,GPIO_PIN_11)
    #define Valve_OFF  gpio_bit_reset(GPIOB,GPIO_PIN_11)
#endif

#ifdef DUAL_MODE
    #define Valve2_ON   gpio_bit_set(GPIOB,GPIO_PIN_10)
    #define Valve2_OFF  gpio_bit_reset(GPIOB,GPIO_PIN_10)
#endif

typedef struct SPos TPos;

struct SPos
{
    TReader *Reader;
    Proc Run;
};

extern TPos Pos;
extern uint8_t G_DualRatModeShow;
extern uint8_t G_key1_flag, G_key2_flag;

void DoMainTask(); 
uint8_t SpecDeduModeTime(void);
uint8_t SpecDeduModePlus(void);
void FreeUsageOnTime();
void FreeUsageOnPlus();

#ifdef DUAL_MODE
void DualRatMode_Show();
// void DoDualModeJudge();
#endif

extern uint16_t (*While_CardOn)(void);
void CPU_M1_While_CardOn();


#endif